//
//  SINATecScoreQuerDetailEvaluationItemViewController.m
//  sinashebao
//
//  Created by  androidlongs on 2018/1/8.
//  Copyright © 2018年  androidlongs. All rights reserved.
//

#import "SINATecScoreQuerDetailEvaluationItemViewController.h"
#import "PieView.h"
@interface SINATecScoreQuerDetailEvaluationItemViewController ()
@property (weak, nonatomic) IBOutlet UIView *scoreQueryDetailView;
@property(strong,nonatomic) PieView *pieView;
@end

@implementation SINATecScoreQuerDetailEvaluationItemViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    PieView *piview = [[PieView alloc] initWithFrame:CGRectMake((kScreenWidth - 340) * 0.5f, 0, 340, 340) dataItems:@[] colorItems:@[[UIColor colorWithHexString:@"#FD8D1F"], [UIColor colorWithHexString:@"#FB4319"], [UIColor colorWithHexString:@"#CDCDCD"],[UIColor colorWithHexString:@"#008EEB"],baseSelectColor
                                                                                                                                                        ] isShowDivi:YES
                                       isClearCenter:NO];
    [self.scoreQueryDetailView addSubview:piview];
    self.pieView = piview;
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 80, 100)];
    
    
    titleLabel.text=@"近期时间\n统计分析";
    titleLabel.font=[UIFont systemFontOfSize:16];
    titleLabel.backgroundColor=[UIColor clearColor];
    titleLabel.textColor=[UIColor blackColor];
    titleLabel.layer.zPosition = 4;
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.center=piview.center;
    //设置字间距
    
    NSDictionary *dic = @{NSKernAttributeName:@2.0f
                          
                          };
    
    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:@"近期时间统计分析" attributes:dic];
    
    NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [@"近期时间统计分析" length])];
    
    [titleLabel setAttributedText:attributedString];
    
    [paragraphStyle setLineSpacing:5];//行间距
    
    
    titleLabel.numberOfLines=0;
    [self.scoreQueryDetailView addSubview:titleLabel];
}

-(void)viewWillAppear:(BOOL)animated{
    self.pieView.centerY= self.scoreQueryDetailView.centerY;
    [self.pieView stroke];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
